package com.zjxf;

import com.zjxf.listener.ApplicationStartup;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

import javax.servlet.MultipartConfigElement;

/**
 * @author ZhangWei
 * @date 2021/3/23/023 20:47
 */
@EnableJpaAuditing
@SpringBootApplication
@ServletComponentScan
public class LmcAdminController {
    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(LmcAdminController.class);
        springApplication.addListeners(new ApplicationStartup());
        springApplication.run(args);
    }

    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory config = new MultipartConfigFactory();
        config.setMaxFileSize("10000MB");
        config.setMaxRequestSize("10000MB");
        return config.createMultipartConfig();
    }
}
